<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        /**
        1.数值解构
         **/
        let arr = [1, 2, 3];
        // 赋值aa,bc
        let [a, b, c] = arr;
        console.info(a, b, c)


        /**
         2.对象解构
         **/
        const person = { name: "zhangsan ", age: 18, languge: ['js', 'java', 'json'] };

        // 赋值给三个变量
        const { name, age, languge } = person;
        console.info(name, age, languge);

        // 赋值给三个变量,重命名
        const { name: a1, age: b1, languge: c1 } = person;
        console.info(a1, b1, c1);


        /**
          3.字符串操作
          **/

         let str1 = "hello,vue";
         console.info(str1.startsWith("h"));
         console.info(str1.endsWith("vue"));
         console.info(str1.includes("vue"));
         console.info(str1.includes("hello"));


           /**
          4.字符串模板 ``
          **/
          let str2 = `dug "sdsds",'sdasdasdas'`;
          console.info(str2);

          function func(){
              return "我是一个函数";
          }

          let str3 = `我是${a1},今年${b1 +20},我想说${func()}`;
          console.info(str3);

    </script>
</body>

</html>